package com.haoxi.gateway.cngpmsg;

public class CNGPActiveTestMessage extends CNGPMessage {

    public CNGPActiveTestMessage() {
        int len = 16;
        buf = new byte[len];
        setMsgLength(len);
        setRequestId(CNGPCommon.CNGP_ACTIVE);
    }

    public CNGPActiveTestMessage(byte[] buf) {
        super.buf = new byte[8];
        if (buf.length != 16) {
            throw new IllegalArgumentException(
                    "The message that is sent by SMC is wrong");
        } else {
            System.arraycopy(buf, 0, super.buf, 0, 16);
        }
    }

    public String toString() {
        StringBuffer strBuf = new StringBuffer();
        strBuf.append("CNGPActiveTestMessage: ");
        strBuf.append("PacketLength=").append(getMsgLength());
        strBuf.append(",RequestID=").append(getRequestId());
        strBuf.append(",Status=").append(getStatus());
        strBuf.append(",SequenceId=").append(getSequenceId());
        return strBuf.toString();
    }
}
